from math import sqrt


def is_palindrome(num):
    temp = num
    total = 0
    while temp>0:
        total = total*10 + temp%10
        temp = temp//10
    return total == num


def is_prime(num):
    if num <= 1:
        return False
    elif num == 2:
        return True
    else:
        for i in range(2, num):
            if num % i == 0:
                return False
            return True if num != 1 else False


if __name__ == '__main__':
    num = int(input('请输入正整数: '))
    if is_palindrome(num) and is_prime(num):
        print('%d是回文素数' % num)
    else:
        print('%d不是回文素数' % num)